﻿using NAudio.Wave;
using NAudio.Wave.SampleProviders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace AudioSourceManager
{
    public class AudioURLSource : IAudioSource
    {
        protected override SampleChannel GetSampleChannel()
        {
            var mf = new MediaFoundationReader(AudioPath);
            SampleChannel sampleChannel = new SampleChannel(mf, false);
            return sampleChannel;
        }

        public override void Dispose()
        {

        }

        public override string GetLog()
        {
            return "";
        }

        public override bool TryMatch(string Path)
        {
            return AudioPath.StartsWith("http") || AudioPath.StartsWith("udp");
        }
    }
}
